#!/bin/sh

## Kill the VirusBarrier Alert

ps -axcopid,command | grep "VirusBarrier Al" | awk '{ system("kill -9 "$1) }'

## Kill the Application

ps -axcopid,command | grep -e 'VirusBarrier X$' | awk '{ system("kill -9 "$1) }'

## unload the Kernel Extension

if [ -d /Library/StartupItems/VirusBarrier/VirusBarrier.kext ]; then
   /sbin/kextunload /Library/StartupItems/VirusBarrier/VirusBarrier.kext
fi

## remove /Library/Intego/virusbarrierd.bundle

if [ -d /Library/Intego/virusbarrierd.bundle ]; then
	rm -r /Library/Intego/virusbarrierd.bundle
fi

## remove /Library/StartupItems/NetBarrier

if [ -d /Library/StartupItems/VirusBarrier ]; then
	rm -r /Library/StartupItems/VirusBarrier
fi

## remove /Library/Preferences/Intego/NetBarrier

if [ -d /Library/Preferences/Intego/VirusBarrier ]; then
	rm -r /Library/Preferences/Intego/VirusBarrier
fi

## remove /Applications/VirusBarrier X.app

if [ -d /Applications/VirusBarrier\ X.app ]; then
	rm -r /Applications/VirusBarrier\ X.app
fi

## remove /Library/Receipts/

if [ -d /Library/Receipts/VirusBarrier.pkg ]; then
	rm -r /Library/Receipts/VirusBarrier.pkg
fi

if [ -f /Library/Receipts/VirusBarrier\ X\ Log.rtf ]; then
	rm -r /Library/Receipts/VirusBarrier\ X\ Log.rtf
fi
